package cn.shuangbofu.guava.event_bus;

import com.google.common.eventbus.EventBus;
import com.google.inject.Singleton;

/**
 * Created by shuangbofu on 2020-04-17 16:05
 */
@Singleton
public class EventNotifier {

    EventBus eventBus;

    public EventNotifier() {
        eventBus = new EventBus();
    }

    public void register(Observer observer) {
        eventBus.register(observer);
    }

    public void notify(Event event) {
        eventBus.post(event);
    }
}
